package com.ketayao.threads.more.queue;

import java.util.concurrent.TimeUnit;

/**
 * @author gl65293
 * 
 */
public class StopThread {

	private int getInfoBuff(char[] buff, int count) {
		char[] temp = new char[count];
		int y = 0, z = 0;
		for (int i = 0; i < count; i++) {

			temp[i] = buff[i];
			if (buff[i] > 127) {
				y = buff[i];
			}

		}
		return y;

	}

	/**
	 * @param args
	 */

	private static boolean stopRequested;

	public static void main(String[] args) throws InterruptedException {

		Thread backgroundThread = new Thread(new Runnable() {
			public void run() {
				int i = 0;
				while (!stopRequested) {
					i++;
				}
			}
		});

		backgroundThread.start();

		TimeUnit.SECONDS.sleep(1);
		stopRequested = true;
	}

}
